<?php
declare (strict_types=1);

namespace app\command;

use app\common\enum\MainEnum;
use app\common\service\Email;
use app\common\service\RabbitMQ;
use app\common\service\Redis;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;

class ServerUp extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('ServerUp')->setDescription('服务器启动后初始化操作');
    }

    protected function execute(Input $input, Output $output)
    {
        //        var_dump(Redis::getStoreConfig('packagePrice'));
        //        Redis::setStoreConfig('packagePrice', 0);
        //        var_dump(Redis::getStoreConfig('packagePrice'));
        //
        //
        //        var_dump(Redis::getStoreConfig('orderPaymentTimedOutMaxTimestamp'));
        //        Redis::setStoreConfig('orderPaymentTimedOutMaxTimestamp', 3600 * 24 * 7);
        //        var_dump(Redis::getStoreConfig('orderPaymentTimedOutMaxTimestamp'));
        #RabbitMQ消费者
        //        $mqModel           = new RabbitMQ();
        //        $confirmSelectType = 3;
        //        $mqModel->setExchange(MainEnum::RabbitMQ['exchange']['消息'])
        //            ->setRoutingKey(
        //                MainEnum::RabbitMQ['routingKey']['消息|用户注册成功']
        //            )
        //            ->setQueue(MainEnum::RabbitMQ['queue']['消息|用户注册成功'])
        //            ->setConfirmSelectType($confirmSelectType)
        //            ->setPrefetchCount(1000);
        //        $consumerTag = 'No.1';
        //        $mqModel->consumer(
        //            $consumerTag,
        //            static function ($message) {
        //
        //            }
        //        );
    }
}
